<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
	<div class="am-g">
		 {include file='../Common/hy_header.html'}
		 <div class="am-g">
			<br>
			
			<div class="am-u-md-8 am-u-end">
				<form class="am-form am-form-horizontal hy-js-form">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">标题</label>
						<div class="am-u-sm-9">
							<input type="text" name="title" value="{$info.title}" placeholder="标题">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label"> 上传图片</label>
			            <div class="am-u-sm-4">
			              <input type="text" name="img_url" class="am-input-sm" value="{$info.img_url}">
			             
			            </div>
			            <div class="am-u-sm-1">
			            	 <img id="hy-thumb" style="height: 30px;" {if $info.img_url}src="/ws{$info.img_url}"{else} src="{$_C.hy_path}images/logo2.png" {/if}>
			            	</div>
			             <div class="am-u-sm-4 am-u-end">
			             	<button class="am-btn am-btn-primary am-btn-xs hy-js-uploadimg" >上传</button>
			          </div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">描述</label>
						<div class="am-u-sm-9">
							<textarea  rows="4" cols="20" name="content" value="{$info.content}" placeholder="">{$info.content}</textarea>
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">页面内容</label>
						<div class="am-u-sm-9">
							<textarea  rows="20" cols="20" name="des_content" class="hy-kindeditor" placeholder=""  >{$info.des_content}</textarea>
						</div>
					</div>
					
					
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<input type="hidden" name="id" value="{$info.id}" />
							<button type="button" class="am-btn am-btn-primary hy-js-submit">{$_L.SAVE}</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	  {include file='../Common/hy_footer.html'}
	  <script type="text/javascript" src="{$_C.hy_path}js/editor/kindeditor.js"></script>
	<script type="text/javascript">
	hungry.kindEditor.editor();
		$(function(){
		  hy_uploadimg('/ad',{},function(result){
	    	if(typeof(result[0])!='undefined')
	    	{
	        	$('#hy-thumb').attr('src','/ws'+result[0]);
	        	$('input[name=img_url]').val(result[0]).focus();
	       }
    	  })
	  })
		var time = 0 ;
	    hy_submit('index.php?g=admin&m=npc&a=updateNpc','',function(result){
			if(result.error==1)
			{
				showMsg(result.content,result.error);
			}
			else
			{
				parent.$('#npcList').attr('src', parent.$('#npcList').attr('src'));
				var tab_li = parent.$(".am-active");
				if(tab_li.prev().length>0)
				{
					tab_li.prev().addClass('am-active');
					var id=tab_li.prev().attr('data-id');
			        parent.$('#'+id).show();
				}
				else if(tab_li.next().length>0)
				{
					tab_li.next().addClass('am-active');
					var id=tab_li.next().attr('data-id');
			        parent.$('#'+id).show();
				}
				else
				{
					var tab='<li data-id="index" class="am-active"><a  href="javascript:;"><span class="hy-tabs-title">首页</span><span class="am-icon-close"></span></a></li>'
				    parent.$('.hy-tabs .am-nav').append(tab);
				    var iframe='<iframe onload="javascript:hy_loading()" id="index" src="index.php?g=admin&m=index&a=main" width="100%" height="100%"></iframe>';
				    parent.$('.hy-iframe').append(iframe);
				}
				var id=tab_li.attr('data-id');
				tab_li.remove();
				parent.$("#"+id).remove();
			}
		});
	</script>
	</body>
</html>
